package com.smartao.core.orm.mybatis;

import org.apache.ibatis.reflection.factory.DefaultObjectFactory;

import com.smartao.core.orm.Page;

public class MybatisObjectFactory extends DefaultObjectFactory {

	private static final long serialVersionUID = 7793869088935792673L;

	/**
	 * 让mybatis将Page对象当作Collection处理
	 */
	@Override
	public <T> boolean isCollection(Class<T> type) {
		if (Page.class.isAssignableFrom(type)) {
			return true;
		}
		return super.isCollection(type);
	}

}
